#include "ThermoObject.h"

#include "IceBlock.h"
#include "IceLayer.h"
#include "MetalBox.h"
#include "Thermo.h"
#include "Water.h"

ThermoObject::ThermoObject(Thermo* tp)
{
	thermo = tp;
	objectID = "thermo object";
}


ThermoObject::~ThermoObject(void)
{
}

void ThermoObject::HandleCollision(GameObject& other, CollisionInfo& info)
{
	if(other.GetObjectID() == "Metal Box")
	{
		MetalBox* tempBox = (MetalBox*)&other;
		tempBox->ApplyHeat(5.0f);
	}
	else if(other.GetObjectID() == "Ice Block")
	{
		IceBlock* ice = dynamic_cast<IceBlock*>(&other);

		if(ice != nullptr)
			ice->ApplyHeat(5.0f);
	}
	else if(other.GetObjectID() == "Ice Layer")
	{
		IceLayer* ice = dynamic_cast<IceLayer*>(&other);

		if(ice != nullptr)
			ice->ApplyHeat(5.0f);
	}
	else if(other.GetObjectID() == "Water")
	{
		Water* water = dynamic_cast<Water*>(&other);

		if(water != nullptr)
			water->ApplyHeat(-5.0);
	}
}

void ThermoObject::Render(void) const
{
	GameObject::Render();
}
